import request from '@/utils/request'

// 获取列表
export function queryDynamicRelationData(params) {
  return request({
    url: 'api/standardRelation/queryDynamicRelationData',
    method: 'get',
    params
  })
}

// 等级下拉拉框修改后，等级说明联动接口
export function queryByComponentLevel(params) {
  return request({
    url: 'api/standardComponentLevel/queryByComponentLevel',
    method: 'get',
    params
  })
}

// 行内编辑更新接口
export function updateStandardRelationItem(data) {
  return request({
    url: 'api/standardRelation/updateStandardRelationItem',
    method: 'post',
    data
  })
}

// 根据专业获取构件管理树
export function queryRelationComponentGroups(query) {
  return request({
    url: 'api/standardRelationConfig/queryRelationComponentGroups',
    method: 'get',
    params: query
  })
}

// 获取图纸管理树
export function queryRelationDrawingGroups(query) {
  return request({
    url: 'api/standardRelationConfig/queryRelationDrawingGroups',
    method: 'get',
    params: query
  })
}

// 新建排除项或必选项
export function submitExclusionsRequired(data) {
  return request({
    url: 'api/standardRelationConfig/submit',
    method: 'post',
    data
  })
}

// 获取排除项和必选项
export function queryBaseConfigItems(query) {
  return request({
    url: 'api/standardRelationConfig/queryBaseConfigItems',
    method: 'get',
    params: query
  })
}

// 获取新增数据提示
export function queryComponentDrawingLog() {
  return request({
    url: 'api/standardRelationLog/queryComponentDrawingLog',
    method: 'get'
  })
}

// 新增必做项或反选删除
export function submitStandardRelationUnitConfig(data) {
  return request({
    url: 'api/standardRelationUnitConfig/submit',
    method: 'post',
    data
  })
}

// 获取单元格里的必做项
export function queryByParam(query) {
  return request({
    url: 'api/standardRelationUnitConfig/queryByParam',
    method: 'get',
    params: query
  })
}

export default { queryDynamicRelationData, queryByComponentLevel, updateStandardRelationItem, queryRelationComponentGroups, queryRelationDrawingGroups, submitExclusionsRequired, queryBaseConfigItems, queryComponentDrawingLog, submitStandardRelationUnitConfig, queryByParam }

